package com.lyEducation.controllers.dto.system;

import com.lyEducation.controllers.dto.BaseCodeDto;
import com.lyEducation.entities.system.SysLevelEntity;

import java.util.Objects;

public class SysLevelDto extends BaseCodeDto {
  private int level;

  public int getLevel() {
    return level;
  }

  public void setLevel(int level) {
    this.level = level;
  }

  public SysLevelEntity getSysLevelEntity() {
    SysLevelEntity level = new SysLevelEntity();
    level.setLevel(this.getLevel());
    level.setName(this.getName());
    return level;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (!(o instanceof SysLevelDto)) return false;
    if (!super.equals(o)) return false;
    SysLevelDto that = (SysLevelDto) o;
    return level == that.level;
  }

  @Override
  public int hashCode() {

    return Objects.hash(super.hashCode(), level);
  }
}
